package com.example.onlinemonitoring.serviceImpl;

import com.example.onlinemonitoring.model.Ascsensor;
import com.example.onlinemonitoring.model.Aschistory;
import org.springframework.stereotype.Service;
import com.example.onlinemonitoring.Util.tem.SensorAbstractBaseService;
import com.example.onlinemonitoring.service.AscsensorService;
import com.example.onlinemonitoring.model.common.chartres;
import com.example.onlinemonitoring.Util.HexUtil;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
* @description Ascsensor接口实现
* @author  generator
* @since  2022-04-09 13:03:09
*/
@Service("ascServiceImpl")
public class AscsensorServiceImpl extends SensorAbstractBaseService<Ascsensor, Aschistory> implements AscsensorService {
     //这里需要重写getDt方法,用来处理图表数据
    //public String[] getDt(List<Aschistory> list,String[] dt,chartres cts,float[][] sres,SimpleDateFormat sdf,SimpleDateFormat csdf,SimpleDateFormat sdf2){return null;}
    @Override
    protected String myCustomName(String field, String string) {
        switch (field) {
            case "ascp":
                switch (string) {
                    case "0": return "分闸";
                    case "1": return "合闸";
                    default: return "未知";
                }
            case "bscp":
                switch (string) {
                    case "0": return "分闸";
                    case "1": return "合闸";
                    default: return "未知";
                }
            case "cscp":
                switch (string) {
                    case "0": return "分闸";
                    case "1": return "合闸";
                    default: return "未知";
                }
            case "busclose":
                switch (string) {
                    case "0": return "未联机";
                    case "1": return "已联机";
                    default: return "未知";
                }
            case "isolate":
            switch (string) {
                    case "0": return "分闸";
                    case "1": return "合闸";
                    default: return "未知";
                }
            default: return "";
        }
	}
}
